with binary_tree;
with ada.text_io;
use ada.text_io;

procedure build123 is
	procedure print_element (item : in integer ) is
	begin
		put(integer'image(item));
	end print_element;

	package int_tree is new binary_tree
	    (integer, "<", ">", "+", "-", print_element);
	use int_tree;

	root_node : tree_node;

begin

	root_node := insert (root_node, 2);
	root_node := insert (root_node, 1);
	root_node := insert (root_node, 3);
	root_node := insert (root_node, 7);
	root_node := insert (root_node, 2);
	root_node := insert (root_node, 0);
	root_node := insert (root_node, 5);
	put_line ("sorted order: ");
	print (root_node);
	new_line;

	mirror (root_node);
	put_line("reverse sorted order: ");
	print (root_node);
	new_line;

	mirror(root_node);

	put_line("doubled: ");
	double (root_node);
	print (root_node);
	new_line;

	put_line ("post order: ");
	printPostOrder (root_node);
	new_line;

	put_line ("possible paths: ");
	printPaths (root_node);

	put ("has path sum 17: ");
	put_line (boolean'image(hasPathSum(root_node, 17, 0)));
	new_line;

	put ("has path sum 7: ");
	put_line (boolean'image(hasPathSum(root_node, 6, 0)));
	new_line;

	put_line ("stats:");
	put_line("size: " & integer'image(size(root_node)));
	put_line("found 2? " & boolean'image(lookup(root_node, 2)));
	put_line("max depth: " & integer'image(maxDepth(root_node)));
	put_line("max: " & integer'image(maxValue(root_node)));
	put_line("min: " & integer'image(minValue(root_node)));



end build123;
